package com.imooc;

import com.imooc.producer.ProducerService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class RocketMqProducerApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(RocketMqProducerApplication.class, args);
        ProducerService producerService = (ProducerService) run.getBean("producerService");
//        producerService.sendMsg();
//        producerService.sendSyncMessage(); // 发送同步消息
//        producerService.sendAsyncMessage(); // 发送异步消息
//        producerService.sendOneWayMessage(); // 单向消息
//        producerService.sendOrderlyMessage();
        producerService.sendDelayMessage();
    }

}
